package cn.itqiqi.student_system_java.conf;

import cn.itqiqi.student_system_java.interceptor.AuthInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 */
@Configuration
public class WebMvcConfiguration implements WebMvcConfigurer {


    @Bean
    public AuthInterceptor initAuthInterceptor(){
        return new AuthInterceptor();
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(initAuthInterceptor())
                .excludePathPatterns("/loginVerify", "/login","/monitor/server")
                .addPathPatterns("/**");

    }


}
